import { getWorkNumberInfo } from '@/api/worknumber'
const workNumber = {
  state: {
    workNumberData: []
  },
  mutations: {
    SET_WORKNUMBERADATA: (state, workNumberData) => {
      state.workNumberData = workNumberData
    }
  },
  actions: {

    // 获取工单数量信息
    WorkNumberGetInfo({ commit }) {
      return new Promise((resolve, reject) => {
        console.log('WorkNumberGetInfo')
        getWorkNumberInfo().then(response => {
          console.log('getInfo')
          const data = response.data
          commit('SET_WORKNUMBERADATA', data)
          console.log(data)
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default workNumber
